<template>
	<view v-if="visible" class="toast" @touchmove.stop.prevent="$stopEvent()">
		<slot name="content"></slot>
		<view class="closed" @click="closed" v-if="showClose">
			<image class="autoImg" src="/static/ico/close2@2x.png" mode=""></image>
		</view>
	</view>
</template>

<script>
	export default {
		props:{
			visible:{
				type:Boolean,
				default:false
			},
			showClose:{
				type:Boolean,
				default:true
			}
		},
		data() {
			return {

			};
		},
		methods:{
			closed(){
				this.$emit('update:visible',false)
			}
		}
	}
</script>

<style lang="scss" scoped>
	.toast{
		position: fixed;
		width: 100%;
		height: 100%;
		top:0;left: 0;right: 0;bottom: 0;
		z-index: 1000;
		background-color: rgba($color: #000000, $alpha: 0.6);
		@include flex_cloumn_center;
		.closed{
			width: 64rpx;
			height: 64rpx;
			margin-top: 72rpx;
			@include flex_center;
		}
	}
</style>
